import axios from 'axios'
// axios.defaults.baseURL='http://127.0.0.1:8888/api/private/v1'

axios.defaults.timeout = '10000'

axios.interceptors.request.use((config) => {
  //添加请求头
  config.headers.Authorization = window.sessionStorage.getItem('token')

  return config
})

axios.interceptors.response.use((res) => {
  try {
    if (res.status == 200) {
      return res.data
    }
  } catch (err) {
    console.log(err)
  }
})

export default axios
